package com.ae;

public class DuckSimulator {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		DuckSimulator simulator = new DuckSimulator(); 
		simulator.simulate(); 

	}

	private void simulate() {
		Quackable mallardDuck = new MallardDuck(); 
		Quackable redheadDuck = new RedheadDuck(); 
		Quackable duckCall = new DuckCall(); 
		Quackable rubberDuck = new RubberDuck(); 
		
		System.out.println("\nDuck simulator is simulated");
		
		simulate(mallardDuck);
		simulate(redheadDuck);
		simulate(duckCall);
		simulate(rubberDuck);		
	}
	
	void simulate(Quackable duck) {
		duck.quack();
	}

}
